package com.chen.service.serviceimpl;

import com.chen.dao.NoticeDao;
import com.chen.pojo.Content;
import com.chen.pojo.Notice;
import com.chen.service.NoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class NoticeServiceImpl implements NoticeService {
    @Autowired
    private NoticeDao noticeDao;

    @Override
    public void addNotice(Notice notice) {
        noticeDao.addNotice(notice);
    }

    @Override
    public List<Notice> getNoticeList(Notice notice) {
        return noticeDao.getNoticeList(notice);
    }

    @Override
    public Notice getNoticeById(Integer id) {
        return noticeDao.getNoticeById(id);
    }

    @Override
    public void updateNotice(Notice notice) {
        noticeDao.updateNotice(notice);
    }

    @Override
    public void deleteNotice(Integer id) {
        noticeDao.deleteNotice(id);
    }

    @Override
    public Notice getNoticeByTitle(String title) {
        return noticeDao.getNoticeByTitle(title);
    }

    @Override
    public void addContent(Content content) {
            noticeDao.addContent(content);
    }

    @Override
    public Content getContentByNid(Integer nid) {
        return noticeDao.getContentByNid(nid);
    }
}
